home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 296_01.zip / FLEXCOM.H < prev    next >
Text File  |  1993-04-01  |  3KB  |  90 lines

  1. /* common macro definitions for C/FTL programs generated by flex */
  2.  
  3.  
  4. /* returned upon end-of-file */
  5. #define YY_END_TOK 0
  6.  
  7. /* action number for an "end-of-file was seen and yywrap indicated that we
  8.  * should continue processing"
  9.  */
  10. #define YY_NEW_FILE -1
  11.  
  12. /* action number for "the default action should be done" */
  13. #define YY_DO_DEFAULT -2
  14.  
  15. #ifndef BUFSIZ
  16. #include <stdio.h>
  17. #endif
  18.  
  19. #define YY_BUF_SIZE (BUFSIZ * 2) /* size of input buffer */
  20.  
  21. /* number of characters one rule can match.  One less than YY_BUF_SIZE to make
  22.  * sure we never access beyond the end of an array
  23.  */
  24. #define YY_BUF_MAX (YY_BUF_SIZE - 1)
  25.  
  26. /* we will never use more than the first YY_BUF_LIM + YY_MAX_LINE positions
  27.  * of the input buffer
  28.  */
  29. #ifndef YY_MAX_LINE
  30. #define YY_MAX_LINE BUFSIZ
  31. #endif
  32.  
  33. #define YY_BUF_LIM (YY_BUF_MAX - YY_MAX_LINE)
  34.  
  35. /* copy whatever the last rule matched to the standard output */
  36.  
  37. #define ECHO fputs( yytext, yyout )
  38.  
  39. /* gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  40.  * is returned in "result".
  41.  */
  42. #define YY_INPUT(buf,result,max_size) \
  43.     if ( (result = read( fileno(yyin), buf, max_size )) < 0 ) \
  44.         YY_FATAL_ERROR( "read() in flex scanner failed" );
  45. #define YY_NULL 0
  46.  
  47. /* macro used to output a character */
  48. #define YY_OUTPUT(c) putc( c, yyout );
  49.  
  50. /* report a fatal error */
  51. #define YY_FATAL_ERROR(msg) \
  52.     { \
  53.     fputs( msg, stderr ); \
  54.     putc( '\n', stderr ); \
  55.     exit( 1 ); \
  56.     }
  57.  
  58. /* returns the first character of the matched text */
  59. #define YY_FIRST_CHAR yy_ch_buf[yy_b_buf_p]
  60.  
  61. /* default yywrap function - always treat EOF as an EOF */
  62. /* #define yywrap() 1 */
  63.  
  64. /* enter a start condition.  This macro really ought to take a parameter,
  65.  * but we do it the disgusting crufty way that old Unix-lex does it
  66.  */
  67. #define BEGIN yy_start = 1 +
  68.  
  69. /* callable from YY_INPUT to set things up so that '%' will match.  Proper
  70.  * usage is "YY_SET_BOL(array,pos)"
  71.  */
  72. #define YY_SET_BOL(array,pos) array[pos - 1] = '\n';
  73.  
  74. /* default declaration of generated scanner - a define so the user can
  75.  * easily add parameters
  76.  */
  77. #define YY_DECL int yylex()
  78.  
  79. /* return all but the first 'n' matched characters back to the input stream */
  80. #define yyless(n) \
  81.     { \
  82.     YY_DO_BEFORE_SCAN; /* undo effects of setting up yytext */ \
  83.     yy_c_buf_p = yy_b_buf_p + n - 1; \
  84.     YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  85.     }
  86.  
  87. /* code executed at the end of each rule */
  88. #define YY_BREAK break;
  89. 
  90.